-
-
Notifications
You must be signed in to change notification settings - Fork 674
n_nodes and number_of_nodes_xxx in tree related classes #40939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
n_nodes and number_of_nodes_xxx in tree related classes #40939
Conversation
Documentation preview for this PR (built with commit db5657d; changes) is ready! 🎉 |
sagemathgh-40940: provide aliases for number_of_inversions and number_of_negative_ones fix sagemath#40935 in ASM as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40940 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton
sagemathgh-40941: provide alias number_of_longest_increasing_subsequences fix sagemath#40935 in permutation as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40941 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton
sagemathgh-40942: provide an alias number_of_relations fix sagemath#40935 in posets as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40942 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton
sagemathgh-40943: provide alias number_of_connected_components fix sagemath#40935 for `connected_components` as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40943 Reported by: Martin Rubey Reviewer(s): David Coudert
sagemathgh-40951: add methods for biconnected components This PR do the following: - add method `number_of_biconnected_components` to follow the proposal of sagemath#40939 - add method `biconnected_components` - move method `is_biconnected` from `graph.py` to `connectivity.pyx` and expose it in `generic_graph.pyx` The addition of method `biconnected_component_containing_vertex` is more involved and deserves its own PR. Indeed, a cut vertex belongs to multiple biconnected components. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40951 Reported by: David Coudert Reviewer(s): Martin Rubey
sagemathgh-40940: provide aliases for number_of_inversions and number_of_negative_ones fix sagemath#40935 in ASM as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40940 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton
sagemathgh-40941: provide alias number_of_longest_increasing_subsequences fix sagemath#40935 in permutation as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40941 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton
sagemathgh-40942: provide an alias number_of_relations fix sagemath#40935 in posets as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40942 Reported by: Martin Rubey Reviewer(s): Frédéric Chapoton
sagemathgh-40943: provide alias number_of_connected_components fix sagemath#40935 for `connected_components` as with sagemath#40939: we have to decide whether this does not pollute the name space too much. URL: sagemath#40943 Reported by: Martin Rubey Reviewer(s): David Coudert
sagemathgh-40951: add methods for biconnected components This PR do the following: - add method `number_of_biconnected_components` to follow the proposal of sagemath#40939 - add method `biconnected_components` - move method `is_biconnected` from `graph.py` to `connectivity.pyx` and expose it in `generic_graph.pyx` The addition of method `biconnected_component_containing_vertex` is more involved and deserves its own PR. Indeed, a cut vertex belongs to multiple biconnected components. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40951 Reported by: David Coudert Reviewer(s): Martin Rubey
This is the last ticket concerning the transition to |
I am not happy with these changes. They make the methods less consistent than they were. |
Let me also note the following idea (I think I asked about it already once, but I cannot find the place anymore). We can hide aliases from tab-completion (or rather: produce aliases hidden from tab-completion) as follows:
I am quite sure that we could also make this more automatic by having a class decorator or something similar. Do you see any downsides, @fchapoton? |
fix #40935 in tree related classes.
cf #40932
Should
number_of_nodes
also be an alias, or perhaps instead ofn_nodes
?Should
n_nodes_to_the_right
,n_nodes_at_depth
also be aliases?Does this pollute the namespace too much?